home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / ScreenShots from MacsBug / TakeScreenShot.c < prev   
Encoding:
C/C++ Source or Header  |  1992-07-15  |  711 b   |  35 lines  |  [TEXT/KAHL]

  1. /*
  2.     TakeScreenShot
  3.     By Brigham Stevens, May 1992
  4.     Apple Computer Developer Technical Support
  5.     
  6.     See the readme file for explanation
  7. */
  8.  
  9. typedef pascal void (*fkeyJSR)();
  10.  
  11. void TakeScreenShot()
  12. {
  13.     Handle            fkeycode;
  14.     fkeyJSR            callAddr;
  15.     
  16.     /* check if FKEY is loaded */
  17.     fkeycode = GetResource('FKEY',3);
  18.     if(!fkeycode) {
  19.         DebugStr("\p••• ERROR: The ScreenShot FKEY did not load.; G");
  20.         goto bail;
  21.     }
  22.     
  23.     /* lock and strip it before we jump on it */
  24.     HLock(fkeycode);
  25.     callAddr = StripAddress(*fkeycode);
  26.  
  27. /* JSR to the FKEY */
  28.     (*callAddr)();
  29.  
  30. bail:
  31. /* get rid of the FKEY and clean the stack */
  32.     ReleaseResource(fkeycode);
  33.     DebugStr("\p ;s;s; PC = savePC");
  34. /* this will leave you sitting in the debugger */
  35. }